﻿using System;
using FreeSql.DataAnnotations;
using ZhonTai.Admin.Core.Attributes;
using ZhonTai.Admin.Core.Entities;
using ZhonTai.Industry.Domain.WorkStation;

#pragma warning disable CS8632

namespace ZhonTai.Industry.Domain.ProductionLine
{
    /// <summary>
    /// 产线配置 实体类
    /// </summary>
    /// <remarks></remarks>
    [Table(Name = "cfg_production_line"), Index("Index_{TableName}_Id", $"{nameof(LineCode)}", true)]
    public partial class ProductionLineEntity : EntityBase
    {
        /// <summary>
        /// 产线编号
        /// </summary>
        /// <remarks>用于唯一标识不同的生产线</remarks>
        [Column(StringLength = 50)]
        public string LineCode { get; set; }

        /// <summary>
        /// 产线名称
        /// </summary>
        /// <remarks>描述产线的名称或编号</remarks>
        [Column(StringLength = 100)]
        public string LineName { get; set; }

        /// <summary>
        /// 产线类型
        /// </summary>
        /// <remarks>例如：自动化产线、半自动化产线、手动产线等）</remarks>
        [Column(StringLength = 50)]
        public string LineType { get; set; }

        /// <summary>
        /// 产线状态
        /// </summary>
        /// <remarks>表示产线的工作状态（如：启用、停用）</remarks>
        public bool Enabled { get; set; }

        /// <summary>
        /// 生产能力
        /// </summary>
        /// <remarks>单位：件/小时），该产线的最大生产能力</remarks>
        [Column(StringLength = 64)]
        public string? Capacity { get; set; }

        /// <summary>
        /// 班次时长
        /// </summary>
        /// <remarks>每班次工作时长</remarks>
        [Column(Precision = 11)]
        public int? ShiftDuration { get; set; }

        /// <summary>
        /// 周时长
        /// </summary>
        /// <remarks>每周工作时长</remarks>
        [Column(Precision = 11)]
        public int? WorkHours { get; set; }

        /// <summary>
        /// 班次数量
        /// </summary>
        /// <remarks>每天班次数量</remarks>
        [Column(Precision = 11)]
        public int? ShiftCount { get; set; }

        /// <summary>
        /// 开始运行时间
        /// </summary>
        /// <remarks></remarks>

        public DateTime? StartTime { get; set; }
        /// <summary>
        /// 停止运行时间
        /// </summary>
        /// <remarks></remarks>

        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 位置
        /// </summary>
        /// <remarks></remarks>
        [Column(StringLength = 255)]
        public string? Location { get; set; }

        /// <summary>
        /// 设备清单
        /// </summary>
        /// <remarks></remarks>
        [Column(StringLength = 255)]
        public string? EquipmentList { get; set; }

        /// <summary>
        /// 工艺流程
        /// </summary>
        /// <remarks></remarks>
        [Column(StringLength = 255)]
        public string? ProcessFlow { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        /// <remarks></remarks>
        [Column(StringLength = 255)]
        public string? Remarks { get; set; }

        /// <summary>
        /// 产线
        /// </summary>
        [NotGen]
        [Navigate(nameof(WorkStationEntity))]
        public ICollection<WorkStationEntity> WorkStations { get; set; }
    }
}

#pragma warning restore CS8632